const express = require("express");
const app = express();

app.get("/list", (req, res) => {
    let params = req.query;
    console.log(params);
	let data = [
		{
			id: 1,
			name: "aaa",
		},
		{
			id: 2,
			name: "bbb",
		},
		{
			id: 3,
			name: "ccc",
		},
    ];
    res.send({
        status: 0,
        data
    })
});
app.post("/list1", (req, res) => {
	let params = req.body;
	console.log(params);
	let data = [
		{
			id: 4,
			name: "ddd",
		},
		{
			id: 5,
			name: "rrr",
		},
		{
			id: 6,
			name: "fff",
		},
	];
	res.send({
		status: 0,
		data,
	});
});
app.listen(8080, () => {
    console.log('监听8080端口，并开启服务');
})
